<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Http\Filters\ProjectFilter;
use App\Models\Project;
use App\Http\Resources\ProjectResource;
class ProjectController extends Controller
{
    //
    public function index(ProjectFilter $filter)
    {
        $projects = Project::query()
            ->filter($filter)
            ->orderByDesc('id')
            ->paginate();

        return $this->ok(ProjectResource::forCollection(ProjectResource::FOR_INDEX, $projects));
    }
}
